feat: apisixupstream subset#172
Merged
Merged
Conversation
…upstream-discovery # Conflicts: # config/crd/bases/apisix.apache.org_apisixupstreams.yaml
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-23T02:07:59Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteInvalidBackendRefUnknownKind
result: failure
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 1
Passed: 31
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests failed with 1 test failures. |
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-23T02:10:48Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
result: partial
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 0
Passed: 32
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests partially succeeded with 1 test skips. |
…s, RBAC, and e2e tests
…upstream-discovery
…upstream-discovery # Conflicts: # internal/controller/utils.go
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces enhancements for the ApisixUpstream controller by adding health check support, refining upstream schema validations, and adjusting resource RBAC and indexing to support pods. Key changes include:
- Adding health check configurations and validations in CRD definitions and translator code.
- Updating tests to cover upstream health checks and subset matching.
- Including pods into RBAC rules, TranslateContext, and indexers for improved resource tracking.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/framework/manifests/ingress.yaml | Added pod resource to RBAC manifest for integration tests |
| test/e2e/apisix/upstream.go | New test file for validating ApisixUpstream error scenarios |
| test/e2e/apisix/route.go | Expanded route tests to cover subsets and health check behaviors |
| internal/utils/k8s.go | Added generic helper functions (AppendFunc, Filter, IsSubsetOf) |
| internal/provider/provider.go | Added Pods field to TranslateContext for tracking pod information |
| internal/provider/adc/translator/apisixupstream.go | Refactored translation functions and added client TLS and health check |
| internal/manager/controllers.go | Updated RBAC annotations to include pods |
| internal/controller/indexer/indexer.go | Enhanced indexing to account for upstream subsets |
| internal/controller/apisixroute_controller.go | Implemented subset filtering in endpoints resolution |
| config/rbac/role.yaml | Updated RBAC role to include pods |
| config/crd/bases/apisix.apache.org_apisixupstreams.yaml | Added detailed validations for upstream properties |
| api/v2/shared_types.go | Declared additional constants for health check types and limits |
| api/v2/apisixupstream_types.go | Updated ApisixUpstreamSpec validations and enums for scheme/passHost |
| api/adc/types.go | Adjusted Nodes field to be optional in the ADC upstream definition |
Comments suppressed due to low confidence (2)
internal/provider/adc/translator/apisixupstream.go:27
- The explicit check for both empty externalNodes and nil discovery has been removed. Please confirm that upstreams without externalNodes, discovery, or subsets are correctly handled by relying solely on CRD XValidation.
)
test/e2e/apisix/route.go:500
- [nitpick] The test case for the upstream health check remains skipped with a FIXME note. Consider tracking this issue and updating the test once the health check synchronization problem is resolved.
PIt("Test Upstream healthcheck", func() {
…ApisixUpstream in standalone mode
AlinsRan
approved these changes
Jun 23, 2025
ronething
reviewed
Jun 23, 2025
ronething
reviewed
Jun 23, 2025
ronething
approved these changes
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change:
What this PR does / why we need it:
Pre-submission checklist: